import requests
import json

# 创建会话
session = requests.Session()

# 发送目标请求
url = "http://198.10.51.2:8090/task/taskCooperation/getTaskCollaborationTable?flag=0&pendingUnitOrg=01020214&flag1=true&crusingStartTime=2024-10-01&crusingEndTime=2024-12-31&checkObjectCategory=5&taskTypeCode=0&pageNo=1&status=0&pageSize=10&depOrg=01020214010205&orgId=1745010892529930321&jsDepOrg=01020214010205&jsOrgName=%E4%BA%BA%E4%BA%8B%E6%95%99%E8%82%B2%E5%A4%84&userId=1746180604009803778"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VySWQiOjE3NDYxODA2MDQwMDk4MDM3NzgsImFjY291bnQiOiJrWkVROXMzcitrNmRibENCRVZ3by9lUUxPRDVUR1hFVFlLMmtIQ3FoSzhJPSIsInV1aWQiOiIyMWVmZjY2Yi00ZTA5LTQyMWItYTJjMy0yZmIxZTY0NTdhNGEiLCJzdWIiOiIxNzQ2MTgwNjA0MDA5ODAzNzc4IiwiaWF0IjoxNzQwODgxNjc2LCJleHAiOjE3NDA5NjgwNzZ9.wUun9QL1Cwu5hah5XRQaOiQ81TBYIbOFrHl5YxcTsnsxVrmXgVwS43Ecbfgi_Lbzvw-LPMCYRBhhEgJI5pqWPw"
}

cookies = {
}

data = {

}

try:

    response_info = session.get(url, headers=headers, cookies=cookies)
    response_info.raise_for_status()  # 检查响应状态码是否为 200
    #print("详情响应内容:", response_info.json())
    partiesDataText = json.loads(response_info.text)
    print("请求响应数据：",partiesDataText)
    partiesList = partiesDataText['data']['rows']
    print("写一个mysql新建表的语句，表名用为ywtg_xunhangjiancha_27_29，表字段是默认字符串，要避免 Row size too large 错误，并翻译成中文注解插入表，",tuple(partiesList[0].keys()))

except requests.exceptions.RequestException as e:
    print(f"请求失败: {e}")
    print("响应内容:", response_info.text)  # 打印原始响应内容